local fn
fn = vim.fn
string.uindex = function(self, index)
  return fn.strcharpart(self, index - 1, 1)
end
string.uslice = function(self, start, len)
  return fn.strcharpart(self, start - 1, len)
end
string.ulen = function(self)
  return fn.strchars(self)
end
local current_line
current_line = function()
  return fn.getline('.')
end
local before_cursor
before_cursor = function()
  local line = vim.fn.getline('.')
  local col = vim.fn.col('.')
  return fn.strpart(line, 0, col - 1)
end
local after_cursor
after_cursor = function()
  local line = vim.fn.getline('.')
  local col = vim.fn.col('.')
  return fn.strpart(line, col - 1)
end
return {
  current_line = current_line,
  before_cursor = before_cursor,
  after_cursor = after_cursor
}
